package com.op.parcel.boot.base;

import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * 基础实体类
 *
 * @author xuan🐽
 */
@Data
public class BaseEntity implements Serializable {
	@TableId(value = "id", type = IdType.ID_WORKER_STR)
	@ApiModelProperty(value = "主键id")
	private String id;

	@ApiModelProperty(value = "创建人")
	@TableField(fill = FieldFill.INSERT)
	private String createBy;

	@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
	@ApiModelProperty(value = "创建时间")
	@TableField(fill = FieldFill.INSERT)
	private LocalDateTime createTime;

	@ApiModelProperty(value = "更新人")
	@TableField(fill = FieldFill.INSERT_UPDATE)
	private String updateBy;

	@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
	@ApiModelProperty(value = "更新时间")
	@TableField(fill = FieldFill.INSERT_UPDATE)
	private LocalDateTime updateTime;

	@ApiModelProperty(value = "是否已删除")
	@TableLogic
	private Integer delFlag = 0;
}
